<template>
  <div>
    <a-drawer :visible="modalVisible" width="1000" @close="handleClose">
      <a-divider orientation="left">详情</a-divider>
      <a-card :bordered="false">
        <f-search-form :more="false" @searchHandler="searchHandler">
          <f-search-form-item label="物料代码" name="materielcode" />
          <f-search-form-item label="工程包代码" name="projectcode" />
        </f-search-form>
        <f-table
          style="margin-top:60px"
          ref="table"
          size="default"
          rowKey="roleId"
              :scroll="{ x: 1800 }"
         :data-source="dataSource"
          :columns="columns"
          :multiple="false"
          :params="queryParam"
        >
        </f-table>
      </a-card>
    </a-drawer>
  </div>
</template>


<script>
export default {
  name: 'TableList',
  components: {},
  
  data() {
    return {
      //列表初始化查询参数
      queryParam: {},
        dataSource: [
          { materielcode: 'YB02D2M038', subjectname: '普通桥架',versionName:'20113.10', budgetprice: '507577.00', supplementaryprice: '486401.00', budgetbudgetcost: '4864011.00',contractprice:'20000.14',budgetthereisacontractprice:'456723.00',budgetnocontractprice:'4213.01',budgettotal:'765263.00' },
         { materielcode: 'YB02D2M039', subjectname: '普通桥架',versionName:'20454.70', budgetprice: '507574.56', supplementaryprice: '486701.11', budgetbudgetcost: '4864011.47',contractprice:'20000.14',budgetthereisacontractprice:'456723.00',budgetnocontractprice:'4213.01',budgettotal:'765263.00' },
         { materielcode: 'YB02D2M040', subjectname: '普通桥架',versionName:'36510.48', budgetprice: '507610.78', supplementaryprice: '486421.00', budgetbudgetcost: '4864711.20',contractprice:'20000.14',budgetthereisacontractprice:'456723.00',budgetnocontractprice:'4213.01',budgettotal:'765263.00' },
         { materielcode: 'YB02D2M010', subjectname: '普通桥架',versionName:'41175.15', budgetprice: '607577.10', supplementaryprice: '486408.03', budgetbudgetcost: '5864011.00',contractprice:'20000.14',budgetthereisacontractprice:'456723.00',budgetnocontractprice:'4213.01',budgettotal:'765263.00' },

        ],
      flag: false,
      modalVisible: false,
       current: 'form1',
      // 表头
      columns: [
        {
          title: '物料代码',
           width: 170,
          dataIndex: 'materielcode'
        },
        {
          title: '科目名称',
               width: 170,
          dataIndex: 'subjectname'
        },
        {
          title: '标前预算金额',
               width: 170,
          dataIndex: 'versionName'
        },
        {
          title: '预算金额',
               width: 170,
          dataIndex: 'budgetprice'
        },
        {
          title: '追加预算金额',
               width: 170,
          dataIndex: 'supplementaryprice'
        },
        {
          title: '预算成本合计',
               width: 170,
          dataIndex: 'budgetbudgetcost'
        },
        {
          title: '合同价',
               width: 170,
          dataIndex: 'contractprice'
        },
        {
          title: '预算总产值有合同价',
     width: 170,
          dataIndex: 'budgetthereisacontractprice'
        },
        {
          title: '预算总产值无合同价',
     width: 170,
          dataIndex: 'budgetnocontractprice'
        },
        {
          title: '预算总产值合计',
               width: 170,
          dataIndex: 'budgettotal'
        },
        {
          title: '实现产值本月实现',
               width: 170,
          dataIndex: 'realizationthismonth'
        },
        {
          title: '实现产值截止上月',
               width: 170,
          dataIndex: 'realizationlastmonth'
        },
        {
          title: '实现产值累计实现',
               width: 170,
          dataIndex: 'realizationcumulative'
        },
        {
          title: '实现比例本月实现',
               width: 170,
          dataIndex: 'proportionthismonth'
        },
        {
          title: '实现比例截止上月',
               width: 170,
          dataIndex: 'proportionlastmonth'
        },
        {
          title: '实现比例累计实现',
               width: 170,
          dataIndex: 'proportioncumulative'
        },
        {
          title: '理论产值本月实现',
               width: 170,
          dataIndex: 'theorythismonth'
        },
        {
          title: '理论产值截止实现',
               width: 170,
          dataIndex: 'theorylastmonth'
        },
        {
          title: '理论产值累计实现',
               width: 170,
          dataIndex: 'theorycumulative'
        }
      ],
      //操作按钮
      operator: [
        {
          name: '添加角色',
          icon: 'plus',
          that: this,
          handler: function(table, that) {
            that.$refs.modal.handleShow()
          }
        },
        {
          name: '删除',
          icon: 'delete',
          batch: true,
          handler: function(table) {
            table.remove()
          }
        }
      ]
    }
  },
  created() {},
  methods: {
    // setStatus(record) {
    //   this.http.post(this, {
    //     url: this.api.managerUser.setStatus,
    //     data: {
    //       userId: record.roleId
    //     },
    //     success(me, data) {
    //       record.status = data
    //     }
    //   })
    // },

    handleShow(data) {
            this.isEdit = false
            this.userName = ''
            if (data && data.userId) {
                this.isEdit = true
                this.userName = data.userName
                this.formData = data
            } else {
                this.formData = {}
            }
            this.modalVisible = true
            this.handleTabClick('form1')
        },
 handleClose() {
            //this.$refs[this.current].handleReset()
            this.modalVisible = false
        },

  }
}
</script>
<style lang='scss' scoped>
//@import url(); 引入公共css类
</style>